package com.umeox.recorder.data;


import android.database.Cursor;
import android.util.Log;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import java.util.List;

import io.reactivex.Completable;
import io.reactivex.Flowable;

@Dao
public interface RecorderDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    Completable save(RecorderBean alarmClock);

    @Delete
    int delete(RecorderBean alarmClock);

    @Delete
    void delete(List<RecorderBean> alarmClocks);


    @Query("DELETE FROM recorder")
    void deleteAll();

    @Query("SELECT * FROM recorder")
    Flowable<List<RecorderBean>> query();
}
